package com.chanzany.decorator;

public class CoffeeBar {
    public static void main(String[] args) {
        //方式1：一杯 加一份牛奶、一份巧克力的美式咖啡
        Drink order = new LongBlack();
        System.out.println("描述:"+order.getDes()+" 费用="+order.cost());
        //加入一份牛奶
        order = new Milk(order);
        System.out.println("描述:"+order.getDes()+" 费用="+order.cost());
        //加入一份巧克力
        order = new Chocolate(order);
        System.out.println("描述:"+order.getDes()+" 费用="+order.cost());

        //方式2：给阿姨来一杯 加一份曲奇，一份牛奶的卡布奇诺
        Drink order2 = new Cookie(new Milk(new Espresso()));
        System.out.println("描述:"+order2.getDes()+" 费用="+order2.cost());
    }
}
